//
//  RNOLRegisterViewController.m
//  RongNiuOnline
//
//  Created by apple on 2018/4/26.
//  Copyright © 2018年 rongniu. All rights reserved.
//

#import "RNOLRegisterViewController.h"
#import "RNOLQuickRegisterView.h"
#import "RNOLLoginViewModel.h"

@interface RNOLRegisterViewController ()

@property (nonatomic,strong) RNOLLoginViewModel *viewModel;

@end

@implementation RNOLRegisterViewController

- (RNOLLoginViewModel *)viewModel{
    if (!_viewModel) {
        _viewModel = [[RNOLLoginViewModel alloc] init];
    }
    return _viewModel;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = kBgColor;
    [self setupNavBarTitleViewWithText:@"注册"];
    [self setup];
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];

}

- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];

}


- (void)setup{
    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, KWIDTH , KHIGHT)];
    [self.view addSubview: scrollView];
    
    RNOLQuickRegisterView *registerView = [RNOLQuickRegisterView FromXIB];
    registerView.frame = CGRectMake(0, 0, KWIDTH , kRegisterPageHeight);
    [scrollView addSubview: registerView];
    scrollView.contentSize = CGSizeMake(KWIDTH, CGRectGetMaxY(registerView.frame)+50);
    
    RAC(self.viewModel,phoneNumber) = registerView.phoneTextField.rac_textSignal;
    RAC(self.viewModel,verifyCode) = registerView.codeTextField.rac_textSignal;
    RAC(self.viewModel,password) = registerView.passwordTextField.rac_textSignal;
    RAC(registerView.registerButton,enabled) = self.viewModel.enableRegisterSignal;
}
@end
